package com.ruoyi.info.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.info.mapper.InfoGradeMapper;
import com.ruoyi.info.domain.InfoGrade;
import com.ruoyi.info.service.IInfoGradeService;

import java.util.List;

/**
 * 年级Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-27
 */
@Service
public class InfoGradeServiceImpl extends ServiceImpl<InfoGradeMapper, InfoGrade> implements IInfoGradeService {

    @Override
    public List<InfoGrade> queryList(InfoGrade infoGrade) {
        LambdaQueryWrapper<InfoGrade> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(infoGrade.getGradeName())){
            lqw.like(InfoGrade::getGradeName ,infoGrade.getGradeName());
        }
        if (StringUtils.isNotBlank(infoGrade.getGradeCode())){
            lqw.eq(InfoGrade::getGradeCode ,infoGrade.getGradeCode());
        }
        return this.list(lqw);
    }

}